README File for "Fear and the Safety Net: Evidence from Secure Communities"

OVERVIEW
========================================
This replication package contains data files and code used to generate the analysis data, figures, tables, and statistics from "Fear and the Safety Net: Evidence from Secure Communities". You need to uncompress SC_Replication.tar.gz using a software like 7-Zip and extract the folders.
 
The code is divided into two Master files that run on Stata:
- Master_Data_Creation.do
- Master_Analysis.do

The replicator should expect the code to run for about 2 hours.


DATA AVAILABILITY AND PROVENANCE (SEE APPENDIX SECTION B FOR MORE INFORMATION)
========================================
- Secure Communities Data on Detainers and Removals are from FOIA requests to the U.S. Immigration and Customs Enforcement and from restricted-use data agreements with the Transactional Records Access Clearinghouse (TRAC, Syracuse University). For information on submitting FOIA requests, visit https://www.ice.gov/foia/request. Data from TRAC is not included in this replication package. For information on applying for access restricted-use data access with TRAC, visit https://trac.syr.edu/fellows/.

- Data from the American Community Survey was downloaded from IPUMS-USA at the University of Minnesota (https://usa.ipums.org/)

- Data from the Current Population Survey was downloaded from IPUMS-CPS at the University of Minnesota (https://ucps.ipums.org/cps/)

- Data on Google Trends from from the website: https://trends.google.com/trends/?geo=US

- Data on distance of each county to the Mexican border is created using the 2010 Census Gazetteer Files: https://www.census.gov/geographies/reference-files/time-series/geo/gazetteer-files.2010.html

- Mexican and Canadian border shapefiles are from the Homeland Infrastructure Foundation-Level Data via the Department of Homeland Security: https://hifld-geoplatform.opendata.arcgis.com/datasets/e735940321bd4383bab528a91bf526f8_0/explore and https://hifld-dhs-gii.opendata.arcgis.com/datasets/8d768582cdc94beeaaebdc8a20f1d4f3_0

- Census Bureau Population Estimates are publicly available and formatted by the National Bureau of Economic Research: https://www.nber.org/research/data/us-census-intercensal-population-estimates

- Data on sanctuary cities are from a February 4 - February 10, 2017 U.S. Immigration and Customs Enforcement report "Weekly Declined Detainer Outcome Report": https://www.ice.gov/doclib/ddor/ddor2017_02-04to02-10.pdf

- The Panel Study of Income Dynamics (PSID) is household-level panel survey data, managed by the Institute for Social Research at the University of Michigan. Much of the data is publicly available, but we also obtain restricted access for counties of current residence and for counties where individuals were born. The PSID data contain information on whether households received food stamps or SSI benefits in the last year. In addition, the dataset includes variables on race, Hispanic ethnicity, age, education, and poverty for individuals within a household. Restricted-use data from the PSID is not included in this replication package. For information on how to apply for restricted-use data, visit https://simba.isr.umich.edu/restricted/RestrictedUse.aspx

- The 2010 Pew Research Survey of Latinos and the 2013 Survey of Hispanics contain questions on immigration enforcement. The data are publicly available, though we obtain restricted state of residence geographic identifiers for the 2010 survey via a data use agreement. Data from Pew is not included in this replication package. To download the public use data, see https://www.pewresearch.org/hispanic/dataset/2010-national-survey-of-latinos/ and https://www.pewresearch.org/hispanic/dataset/2014-national-survey-of-latinos/

- Administrative data on SNAP participation comes from the following website: North Dakota (http://www.nd.gov/dhs/info/pubs/about.html), California (http://www.kidsdata.org/topic/801/food-stamps-race/table#fmt=2361&loc=2,127,347,1763,331,348,336,171,321,345,357,332,324,369,358,362,360,337,327,364,356,217,353,328,354,323,352,320,339,334,365,343,330,367,344,355,366,368,265,349,361,4,273,59,370,326,333,322,341,338,350,342,329,325,359,351,363,340,335&tf=84,79,73,67,64,46,37,16&ch=7,11,1141,10,9,73,127&sortColumnId=0&sortType=asc and http://www.cdss.ca.gov/inforesources/Research-and-Data), Oklahoma (http://www.okdhs.org/sites/searchcenter/Pages/InternetSearchResults.aspx?k=snap#k=food%20stamp%20program%20race), and Minnesota (https://mn.gov/dhs/partners-and-providers/news-initiatives-reports-workgroups/economic-supports-cash-food/).

- Data on 287g policies comes from “Delegation and Divergence”, By Randy Capps, Marc R. Rosenblum, Cristina Rodríguez and Muzaffar Chishti (2011).

- Law Enforcement Agency Indentifiers Crosswalk, 2012 is from the U.S. Bureau of Justice Statistics downloaded using this link: https://www.icpsr.umich.edu/web/NACJD/studies/35158

- DMA to FIPS codes crosswalk is from "Introduction of Television to the United States Media Market, 1946-1960 (ICPSR 22720)" by Matthew Gentzkow and Jesse M. Shapiro. Downloaded from: https://www.icpsr.umich.edu/web/ICPSR/studies/22720

- Data on naturalizations come from the Department of Homeland Security Immigration Yearbook. Downloaded from: https://www.dhs.gov/immigration-statistics/yearbook/2016

MAIN FOLDER DESCRIPTIONS
========================================
- 1code: Contains the all of the code.
- 2input_data: Contains the raw and input data that the Master_Analysis.do file uses.
- 3output_data: Contains the output of Master_Analysis.do.
- 4log: Folder where log files are stored.
- 5figures: Folder where output figures are stored.
- 6tables: Folder where output tables are stored.



COMPUTATION REQUIREMENTS
========================================
- Stata (code was last run with version 16)
	- Necessary dependencies are installed by the header in the Master_Data_Creation.do file


Master Program Descriptions:
=====================================================================================
Program Name: Master_Data_Creation.do
Purpose: Calls all of the dependent code files in "1code\Data Creation" to import, clean, and merge the data in the 2input_data folder.
What to Change: 
- Change the "drive" global in the header of the code file to the location of file address of the Replication Package folder.
	- example: global drive "C:\Users\username\Downloads\SC_Replication"
=====================================================================================
Program Name: Master_Analysis.do
Purpose: Calls all of the dependent code files in "1code\Figures", "1code\Tables" "1code\Appendix Figures", and "1code\Appendix Tables" to create figures and tables.
What to Change: 
- Change the "drive" global in the header of the code file to the location of file address of the Replication Package folder.
	- example: global drive "C:\Users\username\Downloads\SC_Replication"
=====================================================================================
